import Rules from './Rules';

const { COMMON_RULE, EMAIL_RULE, PHONE_RULE, LENGTH_RULE } = Rules;

export const userRule = {
  username: COMMON_RULE().concat(LENGTH_RULE(1, 20)),
  admin: COMMON_RULE({ type: 'number' }),
  enabled: COMMON_RULE({ type: 'number' }),
  email: EMAIL_RULE,
  phone: PHONE_RULE,
  nickname:COMMON_RULE().concat(LENGTH_RULE(1, 20)),
};
